<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>for</title>
</head>
<body>
<h1>循环map</h1>
    <p th:each="map:${map}">
        <span th:text="${map.key}"></span>
        <span th:text="${map.value}"></span>
    </p>

    <p th:if="${a}"><span>a true</span></p>
    <p th:if="${b}"><span>b ""</span></p>
    <p th:if="${c}"><span>c null</span></p>
    <p th:if="${d}"><span>d 10</span></p>
    <p th:if="${e}"><span>e -2</span></p>
    <p th:if="0"><span>000</span></p>

    <p th:unless="0"><span>unless 000</span></p>
    <p th:unless="null"><span>unless null</span></p>
    <p th:unless="${c}"><span>unless ccc</span></p>

    <div th:switch="${user.role.roleName}">
        <p th:case="'管理员'">User is 管理员</p>
        <p th:case="'用户'">User is a 用户</p>
        <p th:case="*">User is some other thing</p>
    </div>
</table>
</body>
</html>